package com.ibiaoke.order.service;

import com.ibiaoke.common.base.Page;
import com.ibiaoke.order.entity.Order;
import com.ibiaoke.order.entity.so.OrderSO;
import com.ibiaoke.order.entity.so.PtOrderSO;
import com.ibiaoke.order.entity.so.SubmitOrderSO;
import com.ibiaoke.order.entity.vo.DateAnalysisVO;
import com.ibiaoke.order.entity.vo.OrderVO;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * Created by huhaichao on 2017/6/8.
 */

public interface OrderService {
    /**
     * 查询订单列表
     * @param orderSO
     * @param page
     * @return
     */
    List<OrderVO> listOrder(OrderSO orderSO, Page page);

    List<OrderVO> listOpenOrder(OrderSO orderSO, Page page);

    OrderVO getOrder(Integer orderId);

    Integer deliverOrder(Integer orderId);

    Integer submitShoppingCartOrder(SubmitOrderSO submitOrderSO);

    @Transactional
    Integer submitGoodsOrder(SubmitOrderSO submitOrderSO);

    Long getOrderNum(Integer customerId, int orderStatus);

    Integer cancelOrder(Integer customerId, Integer orderId);

    int confirmOrder(Integer customerId, Integer orderId);

    String generateOrderNo();

    HashMap<String, DateAnalysisVO> getTodayOrderData(OrderSO orderSO,PtOrderSO ptOrderSO, Page page) ;

    HashMap<String, DateAnalysisVO> getOrderAnalysis(OrderSO orderSO, PtOrderSO ptOrderSO, Page page);

    Integer saveOrder(Order order);

    int payOrder(String orderNo, int payType);

    Order getOrderInfoByCode(String orderNo);

    void sendOrderMessage(Order orderInfo);

    Order useCoupon(Order order, BigDecimal maxPrice, Integer couponReceiveId);

    String changeOrderNo(Integer orderId);

    int autoConfirmOrder();

    void autoCancelOrder();

    List listShopOrder(Integer shopId);

    Order updateOrderStatus(Integer orderId);

    String aggregate(Integer serviceNum, Date startTime, Date endTime);
}
